package com.ch.engine.design.single.hungry;

/**
 * 恶汉-枚举形式，最简洁
 */
public enum HungryEnumSingleton {
    INSTANCE;

    public void print() {
        System.out.println("这是通过枚举获得的实例");
        System.out.println("HungryEnumSingleton.pring()");
    }

    public static void main(String[] args) {
        HungryEnumSingleton singleton2 = HungryEnumSingleton.INSTANCE;
        System.out.println(singleton2);
        singleton2.print();
    }
}